import { request } from './index'

export const userRegister = ({ name, email, password, password_confirmation }) => {
    return request({
        url: '/api/auth/register',
        method: 'post',
        data: {
            name,
            email,
            password,
            password_confirmation
        }
    })
}

export const userLogin = ({ email, password }) => {
    return request({
        url: '/api/auth/login',
        method: 'post',
        data: {
            email,
            password
        }
    })
}

export const userLoginOut = () => {
    return request({
        url: '/api/auth/logout',
        method: 'post'
    })
}

export const getUser = () => {
    return request({
        url: '/api/user',
    })
}